home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- #include <stdarg.h>
-
- void info(char *msg, ...)
- {
- va_list arg;
- char m[256];
-
- va_start(arg, msg);
- vsprintf(m, msg, arg);
-
- if (!inawin && DD != 0)
- DD->FlipToGDISurface();
-
- AfxMessageBox(m, MB_OK | MB_ICONINFORMATION | MB_APPLMODAL);
- }
-
- void warning(char *msg, ...)
- {
- va_list arg;
- char m[256];
-
- va_start(arg, msg);
- vsprintf(m, msg, arg);
-
- if (!inawin && DD != 0)
- DD->FlipToGDISurface();
-
- AfxMessageBox(m, MB_OK | MB_ICONEXCLAMATION | MB_APPLMODAL);
- }
-
- void error(char *msg, ...)
- {
- // Mechanism to prevent errors in error routine
-
- static int error_depth = 0;
- error_depth++;
-
- if (error_depth > 1)
- exit(1);
-
- // Translate the message
-
- va_list arg;
- char m[256];
-
- va_start(arg, msg);
- vsprintf(m, msg, arg);
-
- // Free some game resources for cleaner exit
-
- deinit_game();
-
- // Release clip (if any)
-
- ClipCursor(0);
-
- // Show box
-
- AfxMessageBox(m, MB_OK | MB_ICONERROR | MB_APPLMODAL);
-
- // Exit
-
- exit(1);
- }
-